rm -rf __to_add
rm -rf __to_delete

touch __to_add
touch __to_delete

# get files to be deleted
for f in html/*.html       ; do if [ "$f" != "html/*.html"        -a ! -e .__temp/$f ]; then echo $f >> __to_delete; fi; done
for f in html/*.png        ; do if [ "$f" != "html/*.png"         -a ! -e .__temp/$f ]; then echo $f >> __to_delete; fi; done
for f in html/*.gif        ; do if [ "$f" != "html/*.gif"         -a ! -e .__temp/$f ]; then echo $f >> __to_delete; fi; done
for f in html/*.css        ; do if [ "$f" != "html/*.css"         -a ! -e .__temp/$f ]; then echo $f >> __to_delete; fi; done
for f in html/search/*.html; do if [ "$f" != "html/search/*.html" -a ! -e .__temp/$f ]; then echo $f >> __to_delete; fi; done
for f in html/search/*.png ; do if [ "$f" != "html/search/*.png"  -a ! -e .__temp/$f ]; then echo $f >> __to_delete; fi; done
for f in html/search/*.gif ; do if [ "$f" != "html/search/*.gif"  -a ! -e .__temp/$f ]; then echo $f >> __to_delete; fi; done
for f in html/search/*.css ; do if [ "$f" != "html/search/*.css"  -a ! -e .__temp/$f ]; then echo $f >> __to_delete; fi; done

cd .__temp

# get files to be added
for f in html/*.html       ; do if [ "$f" != "html/*.html"        -a ! -e ../$f ]; then echo $f >> ../__to_add; fi; done
for f in html/*.png        ; do if [ "$f" != "html/*.png"         -a ! -e ../$f ]; then echo $f >> ../__to_add; fi; done
for f in html/*.gif        ; do if [ "$f" != "html/*.gif"         -a ! -e ../$f ]; then echo $f >> ../__to_add; fi; done
for f in html/*.css        ; do if [ "$f" != "html/*.css"         -a ! -e ../$f ]; then echo $f >> ../__to_add; fi; done
for f in html/search/*.html; do if [ "$f" != "html/search/*.html" -a ! -e ../$f ]; then echo $f >> ../__to_add; fi; done
for f in html/search/*.png ; do if [ "$f" != "html/search/*.png"  -a ! -e ../$f ]; then echo $f >> ../__to_add; fi; done
for f in html/search/*.gif ; do if [ "$f" != "html/search/*.gif"  -a ! -e ../$f ]; then echo $f >> ../__to_add; fi; done
for f in html/search/*.css ; do if [ "$f" != "html/search/*.css"  -a ! -e ../$f ]; then echo $f >> ../__to_add; fi; done

# transfer the new documentation files out of the temporary directory
for f in html/*.html       ; do if [ "$f" != "html/*.html"        ]; then mv $f ../$f; fi; done
for f in html/*.png        ; do if [ "$f" != "html/*.png"         ]; then mv $f ../$f; fi; done
for f in html/*.gif        ; do if [ "$f" != "html/*.gif"         ]; then mv $f ../$f; fi; done
for f in html/*.css        ; do if [ "$f" != "html/*.css"         ]; then mv $f ../$f; fi; done
for f in html/search/*.html; do if [ "$f" != "html/search/*.html" ]; then mv $f ../$f; fi; done
for f in html/search/*.png ; do if [ "$f" != "html/search/*.png"  ]; then mv $f ../$f; fi; done
for f in html/search/*.gif ; do if [ "$f" != "html/search/*.gif"  ]; then mv $f ../$f; fi; done
for f in html/search/*.css ; do if [ "$f" != "html/search/*.css"  ]; then mv $f ../$f; fi; done
mv html/installdox          ../html/installdox
mv html/formula.repository  ../html/formula.repository
mv html/search/search.js    ../html/search/search.js

cd ..

# add and delete files
if [ "`wc __to_add    | awk '{ print $2 }'`" != "0" ]; then svn add    `cat __to_add   `; fi
if [ "`wc __to_delete | awk '{ print $2 }'`" != "0" ]; then svn delete `cat __to_delete`; fi

rm -rf __to_add
rm -rf __to_delete
